/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.furb.trabalhoFinal.view;

import javax.swing.JMenuBar;

/**
 *
 * @author Usuario
 */
public class TelaPrincipal extends javax.swing.JFrame {

  /**
   * Creates new form TelaPrincipal
   */
  public TelaPrincipal() {
    initComponents();
  }

  private void abrirColaboradoresTela() {
    ColaboradoresTela colaboradoresTela = new ColaboradoresTela();
    colaboradoresTela.setVisible(true);
  }

  private void abrirLancamentosTela() {
    LancamentosTela lancamentosTela = new LancamentosTela();
    lancamentosTela.setVisible(true);
  }

  private void abrirMarcacoesTela() {
    MarcacoesTela marcacoesTela = new MarcacoesTela();
    marcacoesTela.setVisible(true);
  }

  /**
   * This method is called from within the constructor to initialize the form.
   * WARNING: Do NOT modify this code. The content of this method is always
   * regenerated by the Form Editor.
   */
  @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jMenuPrincipal = new javax.swing.JMenuBar();
        jMenuCargos = new javax.swing.JMenu();
        jMenuColaboradores = new javax.swing.JMenu();
        jMenuMarcacoes = new javax.swing.JMenu();
        jMenuLancamentos = new javax.swing.JMenu();
        jMenuFolhaDePagamento = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jMenuCargos.setText("Cargos");
        jMenuCargos.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jMenuCargosMouseClicked(evt);
            }
        });
        jMenuPrincipal.add(jMenuCargos);

        jMenuColaboradores.setText("Colaboradores");
        jMenuColaboradores.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jMenuColaboradoresMouseClicked(evt);
            }
        });
        jMenuPrincipal.add(jMenuColaboradores);

        jMenuMarcacoes.setText("Marcacoes");
        jMenuMarcacoes.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jMenuMarcacoesMouseClicked(evt);
            }
        });
        jMenuPrincipal.add(jMenuMarcacoes);

        jMenuLancamentos.setText("Lancamentos");
        jMenuLancamentos.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jMenuLancamentosMouseClicked(evt);
            }
        });
        jMenuPrincipal.add(jMenuLancamentos);

        jMenuFolhaDePagamento.setText("Gerar Folha");
        jMenuFolhaDePagamento.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jMenuFolhaDePagamentoMouseClicked(evt);
            }
        });
        jMenuPrincipal.add(jMenuFolhaDePagamento);

        setJMenuBar(jMenuPrincipal);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 400, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 279, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

  private void jMenuCargosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jMenuCargosMouseClicked
    abrirCargosTela();
  }//GEN-LAST:event_jMenuCargosMouseClicked

  private void jMenuColaboradoresMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jMenuColaboradoresMouseClicked
    abrirColaboradoresTela();
  }//GEN-LAST:event_jMenuColaboradoresMouseClicked

  private void jMenuMarcacoesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jMenuMarcacoesMouseClicked
    abrirMarcacoesTela();
  }//GEN-LAST:event_jMenuMarcacoesMouseClicked

  private void jMenuLancamentosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jMenuLancamentosMouseClicked
    abrirLancamentosTela();
  }//GEN-LAST:event_jMenuLancamentosMouseClicked

  private void jMenuFolhaDePagamentoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jMenuFolhaDePagamentoMouseClicked
    abrirFolhaDePagamento();
  }//GEN-LAST:event_jMenuFolhaDePagamentoMouseClicked

  /**
   * @param args the command line arguments
   */
  public static void main(String args[]) {
    /*
     * Set the Nimbus look and feel
     */
    //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
     * If Nimbus (introduced in Java SE 6) is not available, stay with the
     * default look and feel. For details see
     * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
     */
    try {
      for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
        if ("Nimbus".equals(info.getName())) {
          javax.swing.UIManager.setLookAndFeel(info.getClassName());
          break;
        }
      }
    } catch (ClassNotFoundException ex) {
      java.util.logging.Logger.getLogger(TelaPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
    } catch (InstantiationException ex) {
      java.util.logging.Logger.getLogger(TelaPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
    } catch (IllegalAccessException ex) {
      java.util.logging.Logger.getLogger(TelaPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
    } catch (javax.swing.UnsupportedLookAndFeelException ex) {
      java.util.logging.Logger.getLogger(TelaPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
    }
    //</editor-fold>

    /*
     * Create and display the form
     */
    java.awt.EventQueue.invokeLater(new Runnable() {

      public void run() {
        new TelaPrincipal().setVisible(true);
      }
    });
  }

  public JMenuBar getMenu(){
    return jMenuPrincipal;
  }

  public void abrirCargosTela(){
    CargosTela cargosTela = new CargosTela();
    cargosTela.setVisible(true);
  }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenu jMenuCargos;
    private javax.swing.JMenu jMenuColaboradores;
    private javax.swing.JMenu jMenuFolhaDePagamento;
    private javax.swing.JMenu jMenuLancamentos;
    private javax.swing.JMenu jMenuMarcacoes;
    private javax.swing.JMenuBar jMenuPrincipal;
    // End of variables declaration//GEN-END:variables

  private void abrirFolhaDePagamento() {
   FolhaTela folhaTela = new FolhaTela();
   folhaTela.setVisible(true);
  }
}
